#!/usr/bin/python
# -*- coding: utf-8 -*-
# @version        : 1.0
# @Create Time    : 2024/9/6 11:11
# @File           : __init__
# @IDE            : PyCharm
# @desc           : 描述

from fastapi import APIRouter, Depends
from utils.response import SuccessResponse
from . import params, schemas
from apps.base.auth.validate import AllUserAuth, Auth


app = APIRouter()


@app.post("/data/MatListQuery", summary="模拟获取物料主数据")
async def get_material(
        pageIndex: int,
        pageSize: int,
        data: schemas.MaterialSearch,
        auth: Auth = Depends(AllUserAuth())
):
    return {
        "data": [
            {
                "id": 1,
                "matCode": "000000110000000000",
                "matName": "型材|7075-T6511|BAC1509-100673|96|B737",
                "matType": "ZROH",
                "badgeNo": "NAS9309ML-4-02",
                "standard": "AMS-QQ-A-200/11",
                "spec": "BAC1509-100673",
                "version": "10.0",
                "unit": "PC",
                "isValid": 1
            },
            {
                "id": 2,
                "matCode": "000000110000000001",
                "matName": "型材|7075-T6511|BAC1509-100673|96|B737",
                "matType": "ZROH",
                "badgeNo": "CFBL1007AP14-10F",
                "standard": "AMS-QQ-A-200/11",
                "spec": "BAC1509-100673",
                "version": "10.0",
                "unit": "PC",
                "isValid": 1
            },
            {
                "id": 3,
                "matCode": "000000110000000002",
                "matName": "型材|7075-T6511|BAC1509-100673|96|B737",
                "matType": "ZROH",
                "badgeNo": "NAS9309ML-6-05",
                "standard": "AMS-QQ-A-200/11",
                "spec": "BAC1509-100673",
                "version": "10.0",
                "unit": "PC",
                "isValid": 1
            }
        ],
        "pageIndex": pageIndex,
        "pageSize": pageSize,
        "message": "",
        "total": int(pageIndex) * int(pageSize),
        "code": 0
    }
